package com.xuecheng.system.convert;

import com.xuecheng.api.system.model.dto.DictionaryDTO;
import com.xuecheng.system.entity.Dictionary;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * Created on 2021/03/30/11:06 周二
 *
 * @author Lantin
 */

@Mapper
public interface DictionaryConvert {


    DictionaryConvert INSTANCE = Mappers.getMapper(DictionaryConvert.class);

    @Mapping(source = "id", target = "dicId")
    DictionaryDTO dictionaryToDto(Dictionary dictionary);

    @Mapping(source = "dicId", target = "id")
    Dictionary dtoToDictionary(DictionaryDTO dictionaryDTO);

    List<DictionaryDTO> dictionaryToDtoList(List<Dictionary> list);
}
